-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Warning
header aggregation and reporting in crane
#1604
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1604 +/- ##
==========================================
- Coverage 72.80% 72.74% -0.07%
==========================================
Files 118 118
Lines 9440 9452 +12
==========================================
+ Hits 6873 6876 +3
- Misses 1869 1878 +9
Partials 698 698
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Warning
header aggregation and reportingWarning
header aggregation and reporting in crane
I think there are a couple ways we could go with this that will be slightly better than adding We already have There's also I really dislike the There's also the How do you feel about this not being a public API, and instead we have crane pass in a custom transport that does all these warncollectory things until we have a happier public interface? |
I'm fine with that. I'll get something along these lines up shortly. |
opencontainers/distribution-spec#393 seems to be on a good path, so I figured I'd put in a better implementation of warning collection/reporting in ggcr.
registry.WithWarning
topkg/registry
that probabilistically reports the given warning (WithWarning(0.1, "hi")
warns"hi
" 10% of the time)This also updates
cmd/registry
to add demo warnings some % of the time; I'll probably revert this before merging, this is just for demo purposes. Speaking of demo:Logic for parsing the warning message out of the header is pretty janky, and could use some tests.
Clients that use go-containerregistry won't suddenly start reporting warnings without changes. They'll need to inject a transport like
crane
does -- if we thinkcrane
's approach is generally useful we can make it available inpkg/crane
itself.